package cn.bqjr.eily.web.exception.exclass;

import cn.bqjr.eily.utils.I18nUtils;
import cn.bqjr.eily.web.exception.ExceptionMapping;
import org.springframework.http.HttpStatus;

/**
 * 授权异常
 */
public class UnAuthorizedException extends RequestException {

    public UnAuthorizedException() {
        super();
    }

    public UnAuthorizedException(String msg) {
        super(msg);
    }

    public UnAuthorizedException(String msg, Throwable cause) {
        super(msg, cause);
    }

    public UnAuthorizedException(Throwable cause) {
        super(cause);
    }

    @Override
    public ExceptionMapping getExceptionMapping() {
        return new ExceptionMapping(
                HttpStatus.FORBIDDEN, "4003", I18nUtils.getMsg("error.authorized.default"));
    }
}
